package com.example.accessingdatajpa.service;

import com.example.accessingdatajpa.pojo.Customer;
import com.example.accessingdatajpa.pojo.Role;
import com.example.accessingdatajpa.response.RestResponse;

import javax.servlet.http.HttpServletRequest;
import javax.transaction.Transactional;
import java.util.List;

public interface ICustomerService {

    //查询全部用户
    @Transactional
    RestResponse<List<Customer>> queryAllCustomers();

    //新增用户
    @Transactional
    RestResponse<String> addOneCustomer(Customer customer, HttpServletRequest request);


    //用户权限升级
    @Transactional
    RestResponse<Role> updateCustomerAuthority(Long customerId, Long roleId);

    //进行登录认证
    @Transactional
    RestResponse<Long> authenticateCustomer(String userName, String userPassword);

    //删除用户
    @Transactional
    RestResponse<String> deleteOneCustomer(Long customerId);
}
